<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-contest-add">
		<input id="id" name="id"th:value="${contest.id}"  type="hidden">
			<div class="form-group">
			<label class="col-sm-3 control-label">比赛名称：</label>
			<div class="col-sm-8">
				<input id="title" name="title" class="form-control" type="text" th:value="${contest.title}">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">开始时间：</label>
			<div class="col-sm-8 input-group date">
				<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				<input id="startTime" name="startTime" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm" th:value="${#dates.format(contest.startTime,'yyyy-MM-dd HH:mm:ss')}">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">结束时间：</label>
			<div class="col-sm-8 input-group date">
				<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				<input id="endTime" name="endTime" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm" th:value="${#dates.format(contest.endTime,'yyyy-MM-dd HH:mm:ss')}">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">赛事说明：</label>
			<div class="col-sm-8">
				<input id="description" name="description" class="form-control" type="text" th:value="${contest.description}">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">入赛密码：</label>
			<div class="col-sm-8">
				<input id="password" name="password" class="form-control" type="text" th:value="${contest.password}">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">是否锁定：</label>
			<div class="col-sm-8">
				<!--<input id="defunct"  name="defunct" class="form-control time-input" type="text"> -->
				<div class="onoffswitch">
					<input type="checkbox"class="onoffswitch-checkbox" id="defunct" name="defunct" th:checked="${contest.defunct}==1?true:false">
					<label class="onoffswitch-label" for="defunct">
						<span class="onoffswitch-switch"></span>
						<span class="onoffswitch-inner"></span>
					</label>
				</div>
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">开始注册时间：</label>
			<div class="col-sm-8 input-group date">
				<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				<input id="startReg" name="startReg" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm" th:value="${#dates.format(contest.startReg,'yyyy-MM-dd HH:mm:ss')}">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">结束注册时间：</label>
			<div class="col-sm-8 input-group date">
				<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				<input id="endReg" name="endReg" class="form-control" type="text" placeholder="yyyy-MM-dd HH:mm" th:value="${#dates.format(contest.endReg,'yyyy-MM-dd HH:mm:ss')}">
			</div>
		</div>

	
	</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
	var prefix = ctx + "acm/contest"
	$("#form-contest-add").validate({
		onkeyup: false,
		rules:{
			xxxx:{
				required:true,
			},
		}
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/editDo", $('#form-contest-add').serialize());
		}
	}
	$(function(){
		layui.use('laydate', function(){
     		 var laydate = layui.laydate;
     		 var startDate = laydate.render({ 
        		    elem: '#startTime',
        		    type: 'datetime',
    		        theme: 'molv',
    		        trigger: 'click'
     		 });
     		var startDate = laydate.render({ 
    		    elem: '#endTime',
    		    type: 'datetime',
		        theme: 'molv',
		        trigger: 'click'
 		 });
     		var startDate2 = laydate.render({ 
    		    elem: '#startReg',
    		    type: 'datetime',
		        theme: 'molv',
		        trigger: 'click'
 		 });
 		var startDate2 = laydate.render({ 
		    elem: '#endReg',
		    type: 'datetime',
	        theme: 'molv',
	        trigger: 'click'
		 });
		});
	})
</script>
</body>
</html>
